pp108 : getTab Method

getTab Method


This method returns the tab specified by the unique identifier. If such a tab does not exist, then it creates a tab and returns it.

Syntax


oElement = tabID.getTab(sTabID)

Parameters

Parameter

Description

sTabID

Required. String that specifies the unique identifier for the tab to be created.


Return Value


Returns an object which is the tab that is created. This will be a SPAN tag with no content inside it. Below is an example of how the return type would be if tabID is "test".

<SPAN style="WIDTH: 100%; HEIGHT: 100%" tabId="test"/>

Remarks


The method returns a SPAN element as a return type. Once the tab is returned, the data inside the tab can be filled by entering data to theinnerHTMLproperty of the returned SPAN element.

If there is no tab ID specified while calling this function, then a tab will be created with ID "undefined".

Tabs created using this method will not have a caption by default. Also, there will not be a tab header for such tabs. Properties like caption, tooltip etc. for such tabs are set by calling the methods exposed for each tab i.e.,setCaption,setTooltipetc.

Example


The following example shows how getTab() is used to create a tab and populate some data inside it.

//testTab is the ID of the tab
var tab = testTab.getTab("myTab");
//Data inside the tab can open some page using IFRAME element
tab.innerHTML = "<IFRAME src='somepage.htm' style='width:100%;height:100%'>";
//Data inside the tab can also be static HTML elements, apart from loading other pages
tab.innerHTML = "<DIV id="testDIV" style='width:100%;height:100%'>This is a test</DIV>";

See Also


tabs